#单点测试：
    # image = load_image("image/truck.jpg")
    # sam, predictor = load_sam_model()
    # process_image(predictor, image)
    # # 输入点的坐标
    # input_point = np.array([[100, 200]])
    # # 输入点的标签
    # input_label = np.array([1])
    # # 是否输出多个遮罩
    # multimask_output = False
    # mask_input=None
    # input_box=None
    # # 生成新的图片-调用Simple_coordinate_new_image函数
    # masks, scores, logits = predict_mask(predictor, input_point, input_label, multimask_output, mask_input, input_box)
    # save_paths1, save_paths2 = Simple_coordinate_new_image([image], [input_point], [input_label], [input_box], [masks])

#多点测试：
    # image = load_image("image/truck.jpg")
    # sam, predictor = load_sam_model()
    # process_image(predictor, image)
    # # 输入点的坐标
    # input_point = np.array([[100, 200],[200, 300]])
    # # 输入点的标签
    # input_label = np.array([1,0])
    # # 是否输出多个遮罩
    # multimask_output = False
    # mask_input=None
    # input_box=None
    # input_boxes=None
    # # 生成新的图片-调用Simple_coordinate_new_image函数
    # masks, scores, logits = predict_mask(predictor, input_point, input_label, multimask_output, mask_input, input_box)
    # save_paths1, save_paths2 = Simple_coordinate_new_image([image], [input_point], [input_label], [input_box], [masks])


#矩形框测试：
    # image = load_image("image/truck.jpg")
    # sam, predictor = load_sam_model()
    # process_image(predictor, image)
    # # 输入点的坐标
    # input_point = None
    # # 输入点的标签
    # input_label = None
    # # 是否输出多个遮罩
    # multimask_output = False
    # mask_input=None
    # input_box=np.array([425, 600, 700, 875])
    # # 生成新的图片-调用Simple_coordinate_new_image函数
    # masks, scores, logits = predict_mask(predictor, input_point, input_label, multimask_output, mask_input, input_box)
    # save_paths1, save_paths2 = Simple_coordinate_new_image([image], [input_point], [input_label], [input_box], [masks])


#点和矩形框测试：
    # image = load_image("image/truck.jpg")
    # sam, predictor = load_sam_model()
    # process_image(predictor, image)
    # # 输入点的坐标
    # input_point = np.array([[575, 750],[200, 300]])
    # # 输入点的标签
    # input_label = np.array([0,1])
    # # 是否输出多个遮罩
    # multimask_output = False
    # mask_input=None
    # input_box=np.array([425, 600, 700, 875])
    # input_boxes=None
    # # 生成新的图片-调用Simple_coordinate_new_image函数
    # masks, scores, logits = predict_mask(predictor, input_point, input_label, multimask_output, mask_input, input_box)
    # save_paths1, save_paths2 = Simple_coordinate_new_image([image], [input_point], [input_label], [input_box], [masks])


#多框测试：
    # image = load_image("image/truck.jpg")
    # sam, predictor = load_sam_model()
    # process_image(predictor, image)
    # # 是否输出多个遮罩
    # multimask_output = False
    # # 分批提示输入
    # input_boxes = torch.tensor([
    #     [75, 275, 1725, 850],
    #     [425, 600, 700, 875],
    #     [1375, 550, 1650, 800],
    #     [1240, 675, 1400, 750],
    # ], device=predictor.device)
    #
    # # 生成新的图片-调用Simple_coordinate_new_image函数
    # masks = predict_mask2(image,predictor, multimask_output, input_boxes)
    #
    # print(masks.shape)
    # print("msk已完成")
    # save_paths1, save_paths2 = Simple_coordinate_new_image2([image], [input_boxes], [masks])



#批量处理测试：
    # image2 = load_image("image/truck.jpg")
    # image1 = load_image("image/groceries.jpg")
    # sam, predictor = load_sam_model()
    # process_image(predictor, image1)
    # process_image(predictor, image2)
    # # 是否输出多个遮罩
    # multimask_output = False
    # # 分批提示输入
    # input_boxes2 = torch.tensor([
    #     [75, 275, 1725, 850],
    #     [425, 600, 700, 875],
    #     [1375, 550, 1650, 800],
    #     [1240, 675, 1400, 750],
    # ], device=predictor.device)
    # input_boxes1 = torch.tensor([
    #     [450, 170, 520, 350],
    #     [350, 190, 450, 350],
    #     [500, 170, 580, 350],
    #     [580, 170, 640, 350],
    # ], device=predictor.device)
    # # 调整图像大小的转换
    # resize_transform = get_resize_transform(sam)
    # # 生成批量输入
    # batched_input = get_batched_input([image1, image2], [input_boxes1, input_boxes2], sam , resize_transform)
    # # 批量预测
    # batched_output = sam(batched_input, multimask_output=False)
    # # 批量处理
    # batch_process_images(batched_output,[input_boxes1,input_boxes2],[image1, image2])

